<?php
require_once 'conexao.php';

$placa = $_POST['valor_placa'];

$query = "SELECT dt_saida FROM frota WHERE id = (SELECT MAX(id) FROM frota Where placa = '" . $placa . "')";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);

if($row['dt_saida'] == '0000-00-00')
{
    echo "1";
}
else
{
    echo "0";
}

?>
